import React, { Component } from 'react'
import PropTypes from "prop-types"
import MyItem from './MyItem'
import './index.css'
class MyBody extends Component {

    static propTypes = {
        items: PropTypes.array.isRequired,
        checkedChange: PropTypes.func.isRequired,
        deleteChange: PropTypes.func.isRequired,
    }
    render() {
        const { items } = this.props

        return (<div className="body-container">
            {
                items.map(item => <MyItem checkedChange={this.props.checkedChange} deleteChange={this.props.deleteChange} key={item.id} {...item} />)
            }

        </div>)
    }
}

export default MyBody